<template>
  <div>
    <!-- 搜索栏 -->
    <el-card id="search">
      <el-row>
        <el-col :span="20">
          <el-button type="primary" @click="openExternalPage">打开外部链接</el-button>

        </el-col>
      </el-row>
    </el-card>
  </div>
</template>

<script>
import aiApi from '@/api/tbAi'

export default {
  created() {
    // this.openExternalPage()
  },
  mounted() {
    this.searchModel.name = this.name // 将获取到的 name 值赋给 userName
  },
  data() {
    return {
      formLabelWidth: '130px',
      dialogFormVisible: false,
      total: 0,
      searchModel: {
        pageNo: 1,
        pageSize: 10,
        question: ''
      },
      tbQuestionList: []
    }
  },
  methods: {
    openExternalPage() {
      window.open('http://101.201.64.236:4999', '_blank')
    },
    clearForm() {
      this.userForm = {
        // coupon: '0**0'
      }
    },
    getTbQuestionList() {
      aiApi.getTbQuestionList(this.searchModel).then((response) => {
        this.tbQuestionList = response.data.rows
        this.total = response.data.total
      })
    },
    refresh(ques) {
      aiApi.getRefresh(ques.question).then((res) => {
        this.$message({
          type: 'success',
          message: res.message
        })
        this.getSingleQuestion(ques)
      })
    },
    getSingleQuestion(ques) {
      aiApi.getSingleQuestion(ques.question).then((res) => {
        this.tbQuestionList = res.data.rows
        this.total = res.data.total
      })
    }
  }
}
</script>

<style>
#search .el-input {
  width: 200px;
  margin-right: 10px;
}

.el-dialog .el-input {
  width: 85%;
}

.blue-link {
  color: blue;
}

</style>
